package yijy.company.transfer;

import java.io.*;

/**
 * Created by yijy on 2017/6/9.
 */
public class Fis {
    public static void main(String[] args) {
        String localImg = "D:/搜狗高速下载/身份证正面.png";
        String imgFile = "D:/搜狗高速下载/身份证正面1.png";
        new Fis().fisCopy(localImg, imgFile);
    }

    public void fisCopy(String localImg, String imgFile){
        try {
            FileInputStream fis = new FileInputStream(new File(localImg));
            FileOutputStream fos = new FileOutputStream(new File(imgFile));
            byte[] bytes = new byte[4*1024 ];
            int b;
            b = fis.read(bytes);
            while(b!=-1){
                fos.write(bytes,0,b);
                b = fis.read(bytes);
            }
            fis.close();
            fos.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
